knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
David taught me to use conditional print statements to stop the code at a particular iteration and print some output. A better way of doing this is using the browser()
which can trigger when the expr
is equal to TRUE
. In the following example the loop will pause at iteration 556 and allow you to interactively debugging.
for (i in 1:1000) { browser(expr = (i==556)) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.